package main

import (
	"github.com/gin-gonic/gin"
	"net/http"
)

func HelloWorldHandler(c *gin.Context) {
	// gin.Context，封装了request和response
	c.String(http.StatusOK, "hello World!")
}

func main() {
	//1.创建路由
	r := gin.Default()
	//2.绑定路由规则，执行函数
	r.GET("/hello", HelloWorldHandler)
	r.Run()
}
